package com.imufe.chemicalenterprisedangerwarning.entity.query;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.imufe.chemicalenterprisedangerwarning.annotation.ExistId;
import com.imufe.chemicalenterprisedangerwarning.mapper.ChemicalMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.EnterpriseMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.ProjectMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author BaiBan
 * @since 2022/9/26
 */

@ApiModel("项目化学品请求")
@Data
public class ProjectChemicalQuery {

    @ApiModelProperty("项目化学品编号")
    @Null(message = "创建时项目化学品编号不能填", groups = CreateGroup.class)
    @NotNull(message = "修改时项目化学品编号必须填", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty("关联项目编号")
    @ExistId(message = "项目不存在，请选择正确的项目", groups = CreateGroup.class, value = ProjectMapper.class)
    @Null(message = "不允许修改项目", groups = UpdateGroup.class)
    private Long projectId;

    @ApiModelProperty("关联化学品编号")
    @ExistId(message = "化学品不存在，请选择正确的化学品", groups = CreateGroup.class, value = ChemicalMapper.class)
    @Null(message = "不允许修改项目", groups = UpdateGroup.class)
    private Long chemicalId;

    @ApiModelProperty("生产能力，没有生产能力为0")
    private Long production;

    @ApiModelProperty("储存能力，没有储存能力为0")
    private Long storage;
}